import request from '@/utils/request.ts'
import { reqBaseData } from '@/api/type.ts'

enum API {
  POST_PAGE_LIST_URL = '/system/post/list',
  POST_ADD_URL = '/system/post/add',
  POST_EDIT_URL = '/system/post/edit',
  POST_DELETE_URL = '/system/post/delete',
}

/*根据参数进行分页查询*/
export const reqPostPageListUrl = (queryParams: any) => {
  return request({
    url: API.POST_PAGE_LIST_URL,
    method: 'get',
    params: queryParams,
  })
}

/*新增岗位*/
export const reqPostAddUrl = (form: any) => {
  return request({
    url: API.POST_ADD_URL,
    method: 'post',
    data: form,
  })
}

/*修改岗位*/
export const reqPostEditUrl = (form: any) => {
  return request({
    url: API.POST_EDIT_URL,
    method: 'put',
    data: form,
  })
}

/*删除岗位*/
export const reqPostDeleteUrl = (postIds: any) => {
  return request<any, reqBaseData>({
    url: API.POST_DELETE_URL + '/' + postIds,
    method: 'delete',
  })
}
